package chapter7.HashMap;

import java.util.*;
public class Example {
    public static void main(String[] args) {
        Map<Integer, Person> map = new HashMap<Integer, Person>();
        map.put(181, new Person(181, "马先生"));
        Integer number = 181;
        Person person = map.get(number);
        if (person == null) {
            System.out.println("该键对象不存在！");
        }else {
            System.out.println(person.getNumber()+ " "+ person.getName());
        }
    }
}
